<script setup>
import { ref, toRef, toRefs, reactive,  onMounted } from "vue";
import { useRouter ,useRoute} from "vue-router";
import { GetPubCourseapi } from "../../http/api";
const router = useRouter();
const route=useRoute()
const id=route.query.id
const headtitle=ref('')
console.log(id);
const list=ref([])
const getPubCourse=()=>{
  GetPubCourseapi(id).then((res)=>{
    console.log('近期公开课',res);
    headtitle.value=res.data.data.model_name
    // Course.value=res.data.data
    // Courselist.value=res.data.data.course_list.slice(0, 3)
    // console.log('111',Course.value);
    list.value=res.data.data.course_list
  })
}
onMounted(() => {
    getPubCourse()
})
</script>

<template>
  <div>
    <van-nav-bar
      :title="headtitle"
      left-text="返回"
      left-arrow
      @click-left="router.go(-1)"
    />
    <item-box :data="list"></item-box>
  </div>
</template>

<style scoped></style>
